<template>
  <div>
    <device-common :state-show="false" :trend-show="false" />
    <div class="h12" />
    <childs :pdevices="currentDevice.devices" />
  </div>
</template>

<script>
import DeviceCommon from '@/components/Device/common'
import Childs from './component/childs'
import { mapGetters } from 'vuex'
export default {
  components: {
    DeviceCommon,
    Childs
  },
  computed: {
    ...mapGetters(['currentDevice'])
  },
  watch: {
    currentDevice: {
      handler(newVal, oldVal) {
        Object.assign(newVal.states, {
          cellsCount: newVal.cellsCount,
          valvesCount: newVal.valvesCount
        })
      },
      deep: true,
      immediate: true
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
